/*
 * Project Beknyou
 * Copyright (c) 2010-2011 Saint Paul College, All Rights Reserved
 * Redistributions in source code form must reproduce the above
 * Copyright and this condition.
 * The contents of this file are subject to the GNU General Public
 * License, Version 2 (the "License"); you may not use this file
 * except in compliance with the License. A copy of the License is
 * available at http://www.opensource.org/licenses/gpl-license.php.
 */
package com.benkyou.util;

/**
 *
 * @author Austin Allman
 */
public class HTMLColorGenerator {
    private int color;
    public String getColorFromName(String name){
        if(name.length() > 1){
        color = (int) name.getBytes()[0];
        for(int i = 1; i < name.length(); i++){
          color += name.getBytes()[i] * 31337;
        }
       color = Math.abs((color * color) / 7);
     
       return "#" + Integer.toString(color).substring(0, 6);
        }
       else return "#00FFFF";
    }    
    public static void main(String argsp[]){}
}
